package javaer.starter.model;

import com.google.common.collect.Lists;
import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;

import java.util.List;

/**
 * 模块
 *
 * @author yangzhen
 * @date 2023/6/5 10:56
 * @since 1.0.0
 */
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
public class ModuleDependencyModel extends BaseModel {

    public static final String SQL_TEMPLATE = "insert into starter_module_dependency (type_id, module_id, dep_type, dep_id, gmt_create, gmt_modified) values ";

    public static final String SQL_NAME = "starter_module_dependency.sql";

    /**
     * 脚手架类型唯一标识
     */
    String typeId;
    /**
     * 模块唯一标识
     */
    String moduleId;
    /**
     * 依赖类型，分为依赖和模块
     * 1：module；2：jar
     */
    Integer depType;
    /**
     * 依赖唯一标识
     */
    String depId;

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }

    public String getModuleId() {
        return moduleId;
    }

    public void setModuleId(String moduleId) {
        this.moduleId = moduleId;
    }

    public Integer getDepType() {
        return depType;
    }

    public void setDepType(Integer depType) {
        this.depType = depType;
    }

    public String getDepId() {
        return depId;
    }

    public void setDepId(String depId) {
        this.depId = depId;
    }

    @Override
    public List<Object> getSqlValues() {
        return Lists.newArrayList(
                this.typeId,
                this.moduleId,
                this.depType,
                this.depId,
                this.getGmtCreate(),
                this.getGmtModified()
        );
    }
}